package com.ylbh.modules.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ylbh.common.pojo.member.dto.AreaDTO;
import com.ylbh.common.pojo.member.vo.AreaVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *
 *
 * @author ${author}
 * @email ${email}
 * @date 2019-04-15 15:35:45
 */
@Mapper
@Repository
public interface AreaMapper extends BaseMapper<AreaDTO> {

    List<AreaVo> selectByLevel(int id);

    /**
     * 返回所有省信息
     * @return
     */
    List<AreaVo> selectProvinceList();

    /**
     * 返回下级的名字及id
     * @param id
     * @return
     */
    List<AreaVo> selectSubordinateList(@Param(value = "id")Long id);

    /**
     * 根据地区id获取信息
     * @param id
     * @return
     */
    AreaVo selectAddressDetailsById(Integer id);
}
